#define _CRT_SECURE_NO_WARNINGS 1
#include "SeqList.h"

void TestSeqList()
{
	SL sl;

	SeqListInit(&sl);
	SeqListPushFront(&sl, 1);
	SeqListPushFront(&sl, 2);
	SeqListPushFront(&sl, 3);
	SeqListPushFront(&sl, 4);
	Print(&sl);

	//SeqListPopFront(&sl);
	//SeqListPopFront(&sl);
	//Print(&sl);

	SeqListPopBack(&sl);
	Print(&sl);
	SeqListInsert(&sl, 2, 20);
	Print(&sl);
	SeqListErase(&sl, 2);
	Print(&sl);

	SeqListDestroy(&sl);
}

void TestSList()
{
	SLTNode* plist = NULL;
	SListPushBack(&plist, 1);
	SListPushBack(&plist, 2);
	SListPushBack(&plist, 3);
	SListPushBack(&plist, 4);
	Print1(plist);

	SListPushFront(&plist, 100);
	SListPushFront(&plist, 200);
	Print1(plist);

	SListPopBack(&plist);
	SListPopBack(&plist);
	Print1(plist);

	//SListPopFront(&plist);
	//SListPopFront(&plist);
	//Print1(plist);

	SLTNode* pos = SListFind(plist, 200);
	if (pos)
	{
		SListInsert(&plist, pos, 111);
		Print1(plist);
		SListErase(&plist, pos);
		Print1(plist);
	}
}
int main()
{
	//TestSeqList();
	TestSList();
	return 0;
}